///*
// * SystemOutput.cpp
// *
// *  Created on: 10 Jun 2011
// *      Author: al2010
// */
//
//#include "SystemOutput.h"
//
//// C++ includes
//#include <fstream>
//#include <iostream>
//#include <iomanip>
//
//SystemOutput::SystemOutput() :
//system(0)
//{}
//	
//SystemOutput::SystemOutput(const System* system, string timeUnit)
//{
//	Set(system, timeUnit);
//}
//	
//SystemOutput::~SystemOutput()
//{}
//
//void SystemOutput::Set(const System* system, string timeUnit)
//{
//	this->system = system;
//	
//	this->timeUnit = timeUnit;
//}
//
//void SystemOutput::Register(double time, const System* system)
//{
//	dataTime.push_back(time);
//	
//	dataMoles.push_back({});
//	
//	for(unsigned iSpecies = 0; iSpecies < system->GetNumOfSpecies(); ++iSpecies)
//		dataMoles.back().push_back(system->GetMolesOfSpecies(iSpecies));
//}
//
//void SystemOutput::Print() const
//{
//	cout << setw(20) << "Time [" << timeUnit << "],";
//	
//	cout << setw(20) << "DeltaTime [" << timeUnit << "],";
//	
//	for(unsigned iSpecies = 0; iSpecies < system->GetNumOfSpecies(); ++iSpecies)
//		cout << setw(20) << system->GetSpecies(iSpecies).GetName();
//	
//	cout << endl;
//	
//	cout << scientific;
//	
//	for(unsigned iTime = 0; iTime < dataTime.size(); ++iTime)
//	{
//		cout << setw(20) << dataTime[iTime] << ",";
//		
//		cout << setw(20) << dataTime[iTime] - dataTime[((iTime == 0) ? 0 : iTime-1)] << ",";
//		
//		for(unsigned iSpecies = 0; iSpecies < dataMoles[iTime].size(); ++iSpecies)
//			cout << setw(20) << dataMoles[iTime][iSpecies] << ",";
//		
//		cout << endl;
//	}
//}
//
//void SystemOutput::Print(string filename) const
//{
//	ofstream file(filename);
//	
//	file << setw(20) << "Time [" << timeUnit << "],";
//	
//	file << setw(20) << "DeltaTime [" << timeUnit << "],";
//	
//	for(unsigned iSpecies = 0; iSpecies < system->GetNumOfSpecies(); ++iSpecies)
//		file << setw(20) << system->GetSpecies(iSpecies).GetName() << ",";
//	
//	file << endl;
//	
//	file << scientific;
//	
//	for(unsigned iTime = 0; iTime < dataTime.size(); ++iTime)
//	{
//		file << setw(20) << dataTime[iTime] << ",";
//		
//		file << setw(20) << dataTime[iTime] - dataTime[((iTime == 0) ? 0 : iTime-1)] << ",";
//		
//		for(unsigned iSpecies = 0; iSpecies < dataMoles[iTime].size(); ++iSpecies)
//			file << setw(20) << dataMoles[iTime][iSpecies] << ",";
//		
//		file << endl;
//	}
//}
